package a.d;

import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;

public final class k
{
  public static boolean a;
  
  public static int a(w paramw1, w paramw2, w paramw3)
  {
    return a(paramw1.a, paramw1.b, paramw2.a, paramw2.b, paramw3.a, paramw3.b);
  }
  
  public static int a(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, double paramDouble5, double paramDouble6)
  {
    boolean bool = w.e;
    paramDouble3 -= paramDouble1;
    paramDouble4 -= paramDouble2;
    paramDouble5 -= paramDouble1;
    paramDouble6 -= paramDouble2;
    double d = paramDouble5 * paramDouble4 - paramDouble6 * paramDouble3;
    if (!bool) {}
    if (!bool) {}
    return d > 0.0D ? -1 : d < 0.0D ? 1 : 0;
  }
  
  public static boolean b(w paramw1, w paramw2, w paramw3)
  {
    if (!w.e) {}
    return a(paramw1, paramw2, paramw3) > 0;
  }
  
  public static boolean c(w paramw1, w paramw2, w paramw3)
  {
    if (!w.e) {}
    return a(paramw1, paramw2, paramw3) < 0;
  }
  
  public static boolean d(w paramw1, w paramw2, w paramw3)
  {
    if (!w.e) {}
    return a(paramw1, paramw2, paramw3) == 0;
  }
  
  public static int a(w paramw1, w paramw2, w paramw3, w paramw4)
  {
    boolean bool = w.e;
    double d1 = paramw1.a;
    double d2 = paramw1.b;
    double d3 = paramw2.a - d1;
    double d4 = paramw2.b - d2;
    double d5 = d3 * d3 + d4 * d4;
    double d6 = paramw3.a - d1;
    double d7 = paramw3.b - d2;
    double d8 = d6 * d6 + d7 * d7;
    double d9 = d7 * d5 - d4 * d8;
    double d10 = d3 * d8 - d6 * d5;
    double d11 = d4 * d6 - d3 * d7;
    double d12 = paramw4.a - d1;
    double d13 = paramw4.b - d2;
    double d14 = d12 * d12 + d13 * d13;
    double d15 = d9 * d12 + d10 * d13 + d11 * d14;
    if (!bool) {
      if (d15 != 0.0D)
      {
        if (!bool) {}
        return d15 > 0.0D ? 1 : -1;
      }
    }
    return 0;
  }
  
  public static a.c.z a(a.c.z paramz)
  {
    return g.a(paramz);
  }
  
  public static double a(double paramDouble)
  {
    return paramDouble / 180.0D * 3.141592653589793D;
  }
  
  public static double b(double paramDouble)
  {
    return paramDouble * 180.0D / 3.141592653589793D;
  }
  
  public static w a(w paramw1, z paramz1, w paramw2, z paramz2)
  {
    double d1 = paramw1.a();
    double d2 = paramw1.b();
    double d3 = paramw2.a();
    double d4 = paramw2.b();
    return a(d1, d2, d1 + paramz1.a(), d2 + paramz1.b(), d3, d4, d3 + paramz2.a(), d4 + paramz2.b());
  }
  
  public static w b(w paramw1, w paramw2, w paramw3, w paramw4)
  {
    return a(paramw1.a(), paramw1.b(), paramw2.a(), paramw2.b(), paramw3.a(), paramw3.b(), paramw4.a(), paramw4.b());
  }
  
  public static w a(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, double paramDouble5, double paramDouble6, double paramDouble7, double paramDouble8)
  {
    double d1 = paramDouble4 - paramDouble2;
    double d2 = paramDouble1 - paramDouble3;
    double d3 = paramDouble8 - paramDouble6;
    double d4 = paramDouble5 - paramDouble7;
    double d5 = d1 * d4 - d3 * d2;
    if (!w.e) {
      if (d5 == 0.0D) {
        return null;
      }
    }
    double d6 = d1 * paramDouble1 + d2 * paramDouble2;
    double d7 = d3 * paramDouble5 + d4 * paramDouble6;
    double d8 = (d4 * d6 - d2 * d7) / d5;
    double d9 = (d1 * d7 - d3 * d6) / d5;
    return new w(d8, d9);
  }
  
  public static boolean b(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, double paramDouble5, double paramDouble6, double paramDouble7, double paramDouble8)
  {
    boolean bool = w.e;
    if ((bool) || (c(paramDouble1, paramDouble2, paramDouble3, paramDouble4, paramDouble5, paramDouble6) * c(paramDouble1, paramDouble2, paramDouble3, paramDouble4, paramDouble7, paramDouble8) <= 0)) {
      if (bool) {}
    }
    return c(paramDouble5, paramDouble6, paramDouble7, paramDouble8, paramDouble1, paramDouble2) * c(paramDouble5, paramDouble6, paramDouble7, paramDouble8, paramDouble3, paramDouble4) <= 0;
  }
  
  static int c(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, double paramDouble5, double paramDouble6)
  {
    boolean bool = w.e;
    paramDouble3 -= paramDouble1;
    paramDouble4 -= paramDouble2;
    paramDouble5 -= paramDouble1;
    paramDouble6 -= paramDouble2;
    double d = paramDouble5 * paramDouble4 - paramDouble6 * paramDouble3;
    if (!bool) {
      if (d == 0.0D)
      {
        d = paramDouble5 * paramDouble3 + paramDouble6 * paramDouble4;
        if (bool) {
          break label125;
        }
        if (d > 0.0D)
        {
          paramDouble5 -= paramDouble3;
          paramDouble6 -= paramDouble4;
          d = paramDouble5 * paramDouble3 + paramDouble6 * paramDouble4;
          if (bool) {
            break label125;
          }
          if (d < 0.0D) {
            d = 0.0D;
          }
        }
      }
    }
    label125:
    if (!bool) {}
    if (!bool) {}
    return d > 0.0D ? 1 : d < 0.0D ? -1 : 0;
  }
  
  public static w d(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, double paramDouble5, double paramDouble6)
  {
    double d1 = paramDouble5 - paramDouble3;
    double d2 = paramDouble6 - paramDouble4;
    double d3 = d1 * d1 + d2 * d2;
    double d4 = 0.0D;
    if (!w.e)
    {
      if (d3 != 0.0D) {
        d4 = ((paramDouble1 - paramDouble3) * d1 + (paramDouble2 - paramDouble4) * d2) / d3;
      }
    }
    else {
      d4 = Math.min(1.0D, Math.max(0.0D, d4));
    }
    return new w(paramDouble3 * (1.0D - d4) + paramDouble5 * d4, paramDouble4 * (1.0D - d4) + paramDouble6 * d4);
  }
  
  public static double e(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, double paramDouble5, double paramDouble6)
  {
    return d(paramDouble1, paramDouble2, paramDouble3, paramDouble4, paramDouble5, paramDouble6).a(paramDouble1, paramDouble2);
  }
  
  public static Rectangle2D a(Rectangle2D paramRectangle2D1, Rectangle2D paramRectangle2D2, Rectangle2D paramRectangle2D3)
  {
    boolean bool2 = w.e;
    boolean bool1 = w.d;
    if (!bool2) {
      if (paramRectangle2D3 == null) {
        paramRectangle2D3 = new Rectangle2D.Double();
      }
    }
    if (!bool2) {
      if (paramRectangle2D3 != paramRectangle2D2)
      {
        paramRectangle2D3.setRect(paramRectangle2D1);
        if (!bool2)
        {
          if (paramRectangle2D3.getWidth() >= 0.0D)
          {
            if (bool2) {
              break label94;
            }
            if (paramRectangle2D3.getHeight() >= 0.0D) {}
          }
          else
          {
            if (bool2) {
              break label201;
            }
            paramRectangle2D3.setRect(paramRectangle2D2);
          }
        }
        else if (!bool1) {
          return paramRectangle2D3;
        }
        if (bool2) {
          break label201;
        }
        if (paramRectangle2D2.getWidth() < 0.0D) {
          label94:
          return paramRectangle2D3;
        }
        if (bool2) {
          break label201;
        }
        if (paramRectangle2D2.getHeight() < 0.0D) {
          return paramRectangle2D3;
        }
        if (bool2) {
          break label201;
        }
        paramRectangle2D3.add(paramRectangle2D2);
        if (!bool1) {
          return paramRectangle2D3;
        }
      }
    }
    if (!bool2)
    {
      if (paramRectangle2D3.getWidth() >= 0.0D)
      {
        if (bool2) {
          break label178;
        }
        if (paramRectangle2D3.getHeight() >= 0.0D) {}
      }
      else
      {
        if (bool2) {
          break label201;
        }
        paramRectangle2D3.setRect(paramRectangle2D1);
      }
    }
    else if (!bool1) {
      return paramRectangle2D3;
    }
    if (!bool2) {
      if (paramRectangle2D1.getWidth() >= 0.0D)
      {
        label178:
        if (bool2) {
          break label201;
        }
        if (paramRectangle2D1.getHeight() >= 0.0D) {
          paramRectangle2D3.add(paramRectangle2D1);
        }
      }
    }
    label201:
    return paramRectangle2D3;
  }
  
  public static Rectangle2D b(Rectangle2D paramRectangle2D1, Rectangle2D paramRectangle2D2, Rectangle2D paramRectangle2D3)
  {
    boolean bool = w.e;
    if (!bool) {
      if (paramRectangle2D3 == null) {
        paramRectangle2D3 = new Rectangle2D.Double(0.0D, 0.0D, -1.0D, -1.0D);
      }
    }
    double d1 = paramRectangle2D1.getX();
    double d2 = paramRectangle2D2.getX();
    double d3 = paramRectangle2D1.getY();
    double d4 = paramRectangle2D2.getY();
    double d5 = paramRectangle2D1.getWidth();
    double d6 = paramRectangle2D2.getWidth();
    double d7 = paramRectangle2D1.getHeight();
    double d8 = paramRectangle2D2.getHeight();
    if (!bool)
    {
      if (d5 >= 0.0D)
      {
        if (bool) {
          break label145;
        }
        if (d7 >= 0.0D)
        {
          if (bool) {
            break label145;
          }
          if (d6 >= 0.0D)
          {
            if (bool) {
              break label151;
            }
            if (d8 >= 0.0D) {
              break label148;
            }
          }
        }
      }
      if (bool) {
        break label213;
      }
      paramRectangle2D3.setRect(0.0D, 0.0D, -1.0D, -1.0D);
    }
    if (w.d)
    {
      label145:
      label148:
      label151:
      double d9 = Math.max(d1, d2);
      double d10 = Math.max(d3, d4);
      double d11 = Math.min(d1 + d5, d2 + d6);
      double d12 = Math.min(d3 + d7, d4 + d8);
      paramRectangle2D3.setRect(d9, d10, d11 - d9, d12 - d10);
    }
    label213:
    return paramRectangle2D3;
  }
  
  public static Rectangle2D a(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, AffineTransform paramAffineTransform, Rectangle2D paramRectangle2D)
  {
    boolean bool2 = w.e;
    boolean bool1 = w.d;
    double[] arrayOfDouble = new double[8];
    arrayOfDouble[0] = paramDouble1;
    arrayOfDouble[1] = paramDouble2;
    arrayOfDouble[2] = (paramDouble1 + paramDouble3);
    arrayOfDouble[3] = paramDouble2;
    arrayOfDouble[4] = paramDouble1;
    arrayOfDouble[5] = (paramDouble2 + paramDouble4);
    arrayOfDouble[6] = arrayOfDouble[2];
    arrayOfDouble[7] = arrayOfDouble[5];
    paramAffineTransform.transform(arrayOfDouble, 0, arrayOfDouble, 0, arrayOfDouble.length / 2);
    if (!bool2) {
      if (paramRectangle2D == null)
      {
        paramRectangle2D = new Rectangle2D.Double(arrayOfDouble[0], arrayOfDouble[1], 0.0D, 0.0D);
        if (bool2) {
          break label141;
        }
        if (!bool1) {
          break label140;
        }
      }
    }
    paramRectangle2D.setRect(arrayOfDouble[0], arrayOfDouble[1], 0.0D, 0.0D);
    label140:
    label141:
    int i = 2;
    int j = arrayOfDouble.length - 1;
    if (i < j)
    {
      if (bool2) {}
    }
    else
    {
      while (bool2)
      {
        paramRectangle2D.add(arrayOfDouble[i], arrayOfDouble[(i + 1)]);
        i += 2;
        if (bool1) {
          break label250;
        }
        if (!bool1) {
          break;
        }
      }
      paramRectangle2D.setRect(Math.floor(paramRectangle2D.getX()) - 2.0D, Math.floor(paramRectangle2D.getY()) - 2.0D, Math.ceil(paramRectangle2D.getWidth()) + 4.0D, Math.ceil(paramRectangle2D.getHeight()) + 4.0D);
    }
    label250:
    return paramRectangle2D;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.d.k

 * JD-Core Version:    0.7.0.1

 */